home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr27 / gs26.zip / MARKPATH.PS < prev    next >
Text File  |  1993-04-05  |  2KB  |  62 lines

  1. %    Copyright (C) 1993 Aladdin Enterprises.  All rights reserved.
  2. %    Distributed by Free Software Foundation, Inc.
  3. %
  4. % This file is part of Ghostscript.
  5. %
  6. % Ghostscript is distributed in the hope that it will be useful, but
  7. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. % to anyone for the consequences of using it or for whether it serves any
  9. % particular purpose or works at all, unless he says so in writing.  Refer
  10. % to the Ghostscript General Public License for full details.
  11. %
  12. % Everyone is granted permission to copy, modify and redistribute
  13. % Ghostscript, but only under the conditions described in the Ghostscript
  14. % General Public License.  A copy of this license is supposed to have been
  15. % given to you along with Ghostscript so you can know your rights and
  16. % responsibilities.  It should be in a file named COPYING.  Among other
  17. % things, the copyright notice and this notice must be preserved on all
  18. % copies.
  19.  
  20. % markpath.ps
  21. % Mark the corners of a path, drawing it slowly if desired.
  22.  
  23. /Delay where { pop } { /Delay 0 def } ifelse
  24. /setxy0
  25.  { currentpoint /y0 exch def /x0 exch def
  26.  } def
  27. /bip
  28.  { epsx epsy idtransform /ey exch def /ex exch def
  29.    currentpoint ex 2 div ey 2 div rlineto currentpoint 0 ey neg rlineto
  30.    ex neg 0 rlineto 0 ey rlineto lineto lineto
  31.    stroke
  32.  } def
  33. /dally
  34.  { Delay { } repeat
  35.  } def
  36. /movebip
  37.  { /xs 2 index def /ys 1 index def
  38.    gsave newpath mpmx transform moveto setxy0 bip grestore
  39.  } def
  40. /linebip
  41.  { gsave newpath x0 y0 moveto mpmx transform lineto setxy0 bip dally grestore
  42.  } def
  43. /curvebip
  44.  { gsave newpath x0 y0 moveto 5 index 5 index mpmx transform lineto bip
  45.    2 copy mpmx transform moveto 3 index 3 index mpmx transform lineto bip
  46.    x0 y0 moveto
  47.    3 { mpmx transform 6 2 roll } repeat
  48.    curveto setxy0 bip dally grestore
  49.  } def
  50. /closebip
  51.  { xs ys linebip
  52.  } def
  53.  
  54. /markpath        % <matrix> markpath -
  55.  { /mpmx exch def 
  56.    gsave initgraphics 9 dup dtransform grestore
  57.      /epsy exch def   /epsx exch def
  58.    gsave 0 setlinewidth
  59.     { movebip } { linebip } { curvebip } { closebip } pathforall
  60.    grestore
  61.  } def
  62.